package LW.com.Action;

import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

import LW.com.Db.DBOperation;
import LW.com.Model.User;

public class basicOperationregiat extends ActionSupport {
	private static final long serialVersionUID = 1L;
	private User newuser;
	private String repassword;

	public String getRepassword() {
		return repassword;
	}

	public void setRepassword(String repassword) {
		this.repassword = repassword;
	}

	public User getNewuser() {
		return newuser;
	}

	public void setNewuser(User newuser) {
		this.newuser = newuser;
	}

	public String regist() throws Exception {

		DBOperation dbo = new DBOperation();
		Boolean success = dbo.adduser(this.newuser);
		if (success) {
			Map<String, Object> session = ActionContext.getContext().getSession();
			session.put("success", true);
			return SUCCESS;
		}
		return ERROR;
	}

}
